import math


# 设置字段

class Settings():
    def __init__(self):
        self.TICKS_PER_SEC = 60
        # 加载范围
        self.SECTOR_SIZE = 16
        self.WALKING_SPEED = 5
        self.FLYING_SPEED = 15
        self.GRAVITY = 20.0
        self.MAX_JUMP_HEIGHT = 1.0
        # To derive the formula for calculating jump speed, first solve
        #    v_t = v_0 + a * t
        # for the time at which you achieve maximum height, where a is the acceleration
        # due to gravity and v_t = 0. This gives:
        #    t = - v_0 / a
        # Use t and the desired MAX_JUMP_HEIGHT to solve for v_0 (jump speed) in
        #    s = s_0 + v_0 * t + (a * t^2) / 2
        self.JUMP_SPEED = math.sqrt(2 * self.GRAVITY * self.MAX_JUMP_HEIGHT)
        self.TERMINAL_VELOCITY = 50
        self.PLAYER_HEIGHT = 2